from selenium import webdriver
import os


def insert_img(driver,name):
    dir_name=os.path.dirname(__file__)
    up_dir_name=os.path.dirname(dir_name)
    img_name=rf'{up_dir_name}\reports\screenshots\{name}.png'
    print(img_name)
    driver.get_screenshot_as_file(img_name)
if __name__ == '__main__':
    chrome_locaton = r'D:\Soft\chrome-win\chrome.exe'
    options = webdriver.ChromeOptions()
    options.binary_location = chrome_locaton
    driver=webdriver.Chrome(options=options)
    name=1
    insert_img(driver,name)